package com.joshua.spring.spi;

import com.joshua.spring.entity.vo.GlobalResponse;
import com.joshua.spring.exception.ExceptionErrorDecoder;
import com.joshua.spring.fallback.FtConsumerClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

import static com.joshua.spring.constant.ConsumerApiConstants.*;
import static com.joshua.spring.constant.ConsumerApiConstants.Demo.*;

/**
 * description
 * package com.joshua.spring.spi
 * classname  FtConsumerClient
 *
 * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
 * @date 2020/4/2 14:24
 */
@FeignClient(name = APPLICATION_CODE,
        path = CONTEXT_PATH + CONSUMER,
        configuration = {ExceptionErrorDecoder.class},
        fallback = FtConsumerClientFallback.class)
public interface FtConsumerClient {
    /**
     * description:
     *
     * @return {@link GlobalResponse}
     * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
     * @date 2020/4/2 14:28
     */
    @GetMapping(REMOTE_PATH_INFO)
    GlobalResponse pathInfo();

    /**
     * description:
     *
     * @return {@link GlobalResponse}
     * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
     * @date 2020/9/1 10:23
     */
    @GetMapping(REMOTE_QUERY_OBJ)
    GlobalResponse paramsObj();

    /**
     * description:
     *
     * @return {@link GlobalResponse}
     * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
     * @date 2020/9/1 10:23
     */
    @GetMapping(REMOTE_ARRAY)
    GlobalResponse arrayInfo();

    /**
     * description:
     *
     * @return {@link GlobalResponse}
     * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
     * @date 2020/9/1 10:23
     */
    @GetMapping(REMOTE_LIST)
    GlobalResponse listInfo();
}
